package xkp.lesson4;

public class TextAnonyClass {
    public static void main(String[] args) {
/*        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName());
            }
        }).start();*/

        //new Thread(()->System.out.println(Thread.currentThread().getName())).start();
        //匿名内部类
       /* Runnable r = new Runnable() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName());
            }
        };*/
       //Lambda表达式
        //()参数列表
        //->后面内容为方法实现

        Runnable r = ()->System.out.println(Thread.currentThread().getName());

        new Thread(r).start();
    }
}
